/*
 * Copyright (c) 2019-2029, Dreamlu 卢春梦 (596392912@qq.com & www.dreamlu.net).
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package net.dreamlu.system.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.AllArgsConstructor;
import net.dreamlu.common.result.EasyPage;
import net.dreamlu.common.result.PageVO;
import net.dreamlu.system.mapper.VlogCensorMapper;
import net.dreamlu.system.model.VlogCensor;
import net.dreamlu.system.service.IVlogCensorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
@AllArgsConstructor
public class VlogCensorServiceImpl extends ServiceImpl<VlogCensorMapper, VlogCensor> implements IVlogCensorService {

	@Autowired
	private VlogCensorMapper vlogCensorMapper;

	/**
	 * 分页查询表并显示全部数据
	 * @param vlogCensor
	 * @param pageVO
	 * @return
	 */
	@Override
	public EasyPage<VlogCensor> selectPage(VlogCensor vlogCensor, PageVO pageVO) {
		Page<VlogCensor> page = new Page<>();

		page.setSize(pageVO.getRows());
		page.setCurrent(pageVO.getPage());
		QueryWrapper<VlogCensor> vlogCensorQueryWrapper = new QueryWrapper<>();
		Page<VlogCensor> page1 = vlogCensorMapper.selectPage(page, vlogCensorQueryWrapper);
		EasyPage<VlogCensor> easyPage = EasyPage.of(page1);
		return easyPage;
	}
}
